//
//  UsbTransfer.swift
//  VPai
//
//  Created by tedwen on 2017/3/10.
//  Copyright © 2017年 viatech. All rights reserved.
//

import Foundation

// for Host side, APP program recevied a notificaton about a new device
// connected and provide information to TCP2USB
public protocol DeviceListener {
    /**
     * @param snoopString
     * @param status
     * check Status_XXXX
     */
    func onUSBDeviceStatus(final snoopString:String, final status:Int)
    
    /**
     * custom command, invoked in UI thread
     * @param cmd  the command(must >= UsbPacket.CMD_CUSTOM)
     * @param payload the payload, refer to bytes2Int or sth to extract the result.
     */
    func onCustomCommand(cmd:UInt8, payload: [UInt8])
}

public class UsbTransfer {
    public static let Status_Disconnected = 0
    public static let Status_Probe_Start = 1
    public static let Status_Probe_Error = 2
    public static let Status_Connected = 3
    public static let Status_NoPermission = -500
}